<?php
namespace Lib;

class Record
{
    public static $ALL;

    public static function add($key, $value)
    {
        if (is_array($value)) {

            foreach ($value as $sub_key=>$item) {
                self::$ALL[$key][$sub_key] = $item;
            }

        } else {
            self::$ALL[$key][] = $value;
        }

        return true;
    }

    public static function get($key = '')
    {
        return $key ? self::$ALL[$key] : self::$ALL;
    }

    public static function inc($key = '', $num = 1)
    {
        !isset(self::$ALL['COUNT'][$key . '_NUM']) && self::$ALL['COUNT'][$key . '_NUM'] = 0;
        self::$ALL['COUNT'][$key . '_NUM'] += $num;
    }

}
